package vn.edu.nuce.dao;

import org.hibernate.SessionFactory;

import vn.edu.nuce.model.Email;
import vn.edu.nuce.utility.Utility;

public class EmailDaoImpl implements EmailDao{
	private SessionFactory sessionFactory;

	public void addEmail(Email email) {
		email.setId(Utility.genUUID());
		getSessionFactory().getCurrentSession().save(email);
	}

	public SessionFactory getSessionFactory() {
		return sessionFactory;
	}

	public void setSessionFactory(SessionFactory sessionFactory) {
		this.sessionFactory = sessionFactory;
	}

}
